<?php

$mysql_config_file = _SETTINGSPATH_ . "/mysql.ser";
if (file_exists($mysql_config_file))
{
    $mysql_config = unserialize(file_get_contents($mysql_config_file));
    $mysql_config['mysqlpass'] = "";
    $smarty->assign("mysql_config", $mysql_config);
}

if ($p_data)
{
    if (empty($p_data["mysqlpass"]))
        $p_data["mysqlpass"] = $mysql_config['mysqlpass'];
    file_put_contents($mysql_config_file, serialize($p_data));
}



if ($WideSql)
{
    $query = $WideSql->testConnection();
    if (!$query)
    {
        $query = $WideSql->getError();
    }
}

$smarty->assign("mysql_status", $query);

if ($query)
{
    $smarty->assign("mysql_info", $WideSql->allTables());
}

return $smarty->fetch('config.tpl');
?>